#include "getGaoDeWeatherCmd.h"
#include "QStringList"

getGaoDeWeatherCmd::getGaoDeWeatherCmd(QObject *parent) :
    BaseCmd(parent)
{
    this->m_protocolType = ProtocolType::HttpProtocol;
   this->m_functionCode = FunctionCode;

}

void getGaoDeWeatherCmd::unPackage(Package package)
{
        QString tmp = package.body();
        QStringList tmpList;

        tmpList = tmp.split(",");
        m_temperature = tmpList.at(0);
        m_humidity = tmpList.at(1);
}

Package getGaoDeWeatherCmd::toPackage()
{
    Package package;


    QString body("key=e417721f96002540cd7e2bb05f1ca9db&city=440113");
   // body+=m_token;
  //  body+="&pos=1";
    package.setBody(body.toLatin1());


    return package;
}

QString getGaoDeWeatherCmd::getTemperature()
{
    return m_temperature;
}
QString getGaoDeWeatherCmd::getHumidity()
{
    return m_humidity;
}

